<div id="redbox_contents_div" class="redbox_contents" style="width:500px;">
	<div class="head">
		<%= link_to_close_redbox image_tag("close.gif"), :style => "float:right; margin-left:0.5em; vertical-align:middle;" -%>
		<span style="vertical-align:middle;">
			<%= @error_text.blank? ? "'#{@group_name}' #{@group_instance.class.name.underscore.titleize} Members" : "Error" -%>
			<%= image_tag icon_filename_for_key("spinner"), :id => "fav_group_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle;" -%>
		</span>
	</div>
	
	<div class="body">
		<% if @error_text.blank? -%>
		  <% group_members = @group_instance.people -%>
			<% unless group_members.empty? -%>
			  <div class="box_infotext" style="margin-bottom: 1.5em; text-align: justify;">
			  	Individual access rights were preset to the value you chose in the main window. Now
					you can specify individual access rights for every member of this <%= @group_instance.class.name.underscore.titleize -%>.
					Individual permissions will be created for those members, who will get access rights which differ from your original
					selection.
			  </div>
				
				<div class="box_simple" style="max-height: 20em; overflow-y: auto;">
					<table>
				  	<% group_members.each do |p| -%>
						  <tr>
						  	<td id="work_group_member_person_<%= p.id -%>" style="text-align: left;"><%= "#{p.first_name} #{p.last_name}" -%></td>
								<td>
									<select id="work_group_access_rights_select_person_<%= p.id -%>" style="width: 220px; vertical-align: middle;">
									  <option value="<%= Policy::NO_ACCESS -%>" <%= "selected" if @access_type == Policy::NO_ACCESS -%> >no access</option>
										<option value="<%= Policy::VIEWING -%>" <%= "selected" if @access_type == Policy::VIEWING -%> >viewing only</option>
									  <option value="<%= Policy::DOWNLOADING -%>" <%= "selected" if @access_type == Policy::DOWNLOADING -%> >viewing and downloading only</option>
									  <option value="<%= Policy::EDITING -%>" <%= "selected" if @access_type == Policy::EDITING -%> >viewing, downloading and editing</option>
									</select>
								</td>
						  </tr>
						<% end -%>
				  </table>
				</div>
			<% else -%>
			  <span class="none_text">No known members at the moment</span>
			<% end -%>
			
			
			<p style="text-align: center; margin-top: 1em;">
				<input type="button" value="Add" style="width: 150px;" onclick="javascript: addProjectInstitutionReviewed(); return(false);" />
				<input type="button" value="Cancel" style="width: 150px;" onclick="javascript: RedBox.close(); return(false);" />
			</p>
			
		<% else -%>
		  <%= @error_text -%>
			<input type="button" value="Close" style="width: 150px;" onclick="javascript: RedBox.close(); return(false);" />
	  <% end -%>
	</div>
</div>